package com.dlut.java2;

import java.util.HashSet;
import java.util.Scanner;

/**
 * @Author: LiuHeng
 * @Description:
 * @Date: 2022-09-08 18:15
 */
public class T0913_BoHaiBank {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        HashSet<Integer>[] sets = new HashSet[n+1];
        for (int i = 0; i <= n; i++) {
            sets[i] = new HashSet<>();
        }
        for (int i = 0; i < m; i++) {
            int k1 = in.nextInt();
            int k2 = in.nextInt();
            sets[k1].add(k2);
            sets[k2].add(k1);
        }
        HashSet<Integer> node1;
        int[] arr = new int[5];
        int count = 0;
        for (int i = 1; i <= n; i++) {
            node1 = sets[i];
            arr[0] = i;
            for(int num1 : node1){
                arr[1] = num1;
                for (int num2 : sets[num1]){
                    arr[2] = num2;
                    for (int num3 : sets[num2]){
                        arr[3] = num3;
                        if (judge(arr)){
                            count++;
                        }
                    }
                }
            }
        }
        System.out.println(count);
    }

    private static boolean judge(int[] arr) {
        int n1=arr[0];
        int n2=arr[1];
        int n3=arr[2];
        int n4=arr[3];
        if (n1 == n2 || n1 == n3 || n2 == n3 || n2 == n4 || n3 == n4 )
            return false;
        return true;
    }
}
